'use strict'

const path = require('path');
const db   = require(path.join(__dirname, '..', 'models'));

function syncDB() {
  db.sequelize.sync().then(()=> {
    console.log('Sync database table finished!');
  }).catch(function(err) {
    console.log(err.message);
  })
}

if (!module.parent) {
  syncDB();
}

module.exports.syncDB = syncDB;